package model;

import java.sql.ResultSet;

import controller.Controller;
import dao.IStorage;
import dao.MySQLDatabase;

import entities.Mesa;
import entities.QueryResult;
import filters.IFilter;

public class Model implements Runnable{
	
	private IStorage storage;
	private Controller controller;
	
	public Model(Controller cont)
	{
		 this.controller = cont;
	}
	
	@Override
	public void run() {
		try {
			this.storage = new MySQLDatabase();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}		
	}
	
	public boolean store(Mesa m){
		return storage.store(m);
	}
		
	public QueryResult query(IFilter filter){
		return storage.query(filter);
	}
}
